﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Lucene.Net.Documents;

namespace Vit.PlugIn.Lucene.Converters
{
    internal class InternalLuceneConverter
    {
        internal static Field.Store ConvertToFieldStore(string value)
        {
            switch (value.ToUpper())
            {
                case "COMPRESS": return Field.Store.COMPRESS;
                case "NO": return Field.Store.NO;
                case "YES": return Field.Store.YES;
                default:
                    throw new ArgumentException(string.Format("UnrecognizedFieldStore : {0}", value));
            }
        }
        internal static Field.Index ConvertToFieldIndex(string value)
        {
            switch (value.ToUpper())
            {
                case "NO": return Field.Index.NO;
                case "NO_NORMS": return Field.Index.NO_NORMS;
                case "TOKENIZED": return Field.Index.TOKENIZED;
                case "UN_TOKENIZED": return Field.Index.UN_TOKENIZED;
                default:
                    throw new ArgumentException(string.Format("UnrecognizedFieldIndex : {0}", value));
            }
        }
    }
}
